﻿@model LetLord.Models.Tenant
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Edit your personal information</h3>
</div>
@using (Ajax.BeginForm("EditTenantDetails", "Tenants", FormMethod.Post,
                        new AjaxOptions
                        {
                            InsertionMode = InsertionMode.Replace,
                            HttpMethod = "POST",
                            UpdateTargetId = "tenant-details"
                        }))
{
    foreach (var photo in Model.ReferencePhotos)
    {
        Html.Hidden("ReferencePhotos", photo);
    }
    foreach (var member in Model.TenantGroupMembers)
    {
        Html.Hidden("TenantGroupMember", member);
    }
    foreach (var viewing in Model.Viewings)
    {
        Html.Hidden("Viewing", viewing);
    }
    @Html.HiddenFor(x => x.UserId)
    @Html.HiddenFor(x => x.AccountTypeString)
    @Html.HiddenFor(x => x.DesiredNumberOfBedroomsString)
    @Html.HiddenFor(x => x.DesiredPropertyLocation)
    @Html.HiddenFor(x => x.HasChildren)
    @Html.HiddenFor(x => x.HasRentAllowance)
    @Html.HiddenFor(x => x.IsInGroup)
    @Html.HiddenFor(x => x.IsProfessional)
    @Html.HiddenFor(x => x.IsStudent)
    @Html.HiddenFor(x => x.MaxBudget)
    @Html.HiddenFor(x => x.MinBudget)
    @Html.ValidationSummary()
    @Html.AntiForgeryToken()
    <div class="modal-body">
        @Html.Bootstrap().ControlGroup().TextBoxFor(x => x.UserName).HtmlAttributes(new { @readonly = "readonly" })
        @Html.Bootstrap().ControlGroup().TextBoxFor(x => x.FirstName)
        @Html.Bootstrap().ControlGroup().TextBoxFor(x => x.LastName)
        @Html.Bootstrap().ControlGroup().TextBoxFor(x => x.TenantAge)
        @Html.Bootstrap().ControlGroup().TextBoxFor(x => x.Email)
        @Html.Bootstrap().ControlGroup().TextAreaFor(x => x.PersonalDescription)
    </div>
    <div class="modal-footer">
        <button class="btn btn-inverse" id="btn-save-edit-tenant-details" type="submit">Save</button>
    </div>
}

